package core.basic;

import java.util.ArrayList;
import java.util.List;



public class DominoSet {
	
	private List<Piece> pieces;
	
	public DominoSet() {
		pieces = new ArrayList<Piece>();
		for (int i = 0; i <=6 ; i++) {
			for (int j = i; j <= 6 ; j++) {
				pieces.add(new Piece(i, j));
			}
		}
	}
	public Piece drawRandom(){
		if(remainingPieces()>0)
			return pieces.remove(((int)(Math.random()*10000))%remainingPieces());
		return null;
	}
	public int remainingPieces() {
		return this.pieces.size();
	}
}
